﻿#region Copyright

// /*
// SilverlightInEnterprise
// SilverlightInEnterprise.VisualStateManagerDemo
// SampleDataSource.xaml.cs
// 
// Author: Matt Van Horn
// Created 11/17/2011 1:17 PM
// Copyright: Silverlight in the Enterprise www.slinenterprise.com
// 
// Licensed under MS-PL http://www.opensource.org/licenses/MS-PL and while you 
// may use this in anyway you see fit and owe us nothing to do so, we wouldn't mind knowing that you got value out of the work we did (so we will do more) so 
// we ask that you leave a comment on www.slinenterprise.com or on the codeplex site slinenterprise.codeplex.com
// 
// */

#endregion

namespace Expression.Blend.SampleData.SampleDataSource
{
// To significantly reduce the sample data footprint in your production application, you can set
// the DISABLE_SAMPLE_DATA conditional compilation constant and disable sample data at runtime.
#if DISABLE_SAMPLE_DATA
	internal class SampleDataSource { }
#else

    public class SampleDataSource : System.ComponentModel.INotifyPropertyChanged
    {
        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;

        protected virtual void OnPropertyChanged(string propertyName)
        {
            if (this.PropertyChanged != null)
            {
                this.PropertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
            }
        }

        public SampleDataSource()
        {
            try
            {
                System.Uri resourceUri =
                    new System.Uri(
                        "/SilverlightInEnterprise.VisualStateManagerDemo;component/SampleData/SampleDataSource/SampleDataSource.xaml",
                        System.UriKind.Relative);
                if (System.Windows.Application.GetResourceStream(resourceUri) != null)
                {
                    System.Windows.Application.LoadComponent(this, resourceUri);
                }
            }
            catch (System.Exception)
            {
            }
        }

        private ItemCollection _Collection = new ItemCollection();

        public ItemCollection Collection
        {
            get { return this._Collection; }
        }
    }

    public class Item : System.ComponentModel.INotifyPropertyChanged
    {
        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;

        protected virtual void OnPropertyChanged(string propertyName)
        {
            if (this.PropertyChanged != null)
            {
                this.PropertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
            }
        }

        private string _Agent_Name = string.Empty;

        public string Agent_Name
        {
            get { return this._Agent_Name; }

            set
            {
                if (this._Agent_Name != value)
                {
                    this._Agent_Name = value;
                    this.OnPropertyChanged("Agent_Name");
                }
            }
        }

        private double _Percent_Complete = 0;

        public double Percent_Complete
        {
            get { return this._Percent_Complete; }

            set
            {
                if (this._Percent_Complete != value)
                {
                    this._Percent_Complete = value;
                    this.OnPropertyChanged("Percent_Complete");
                }
            }
        }

        private string _Assigned_Date = string.Empty;

        public string Assigned_Date
        {
            get { return this._Assigned_Date; }

            set
            {
                if (this._Assigned_Date != value)
                {
                    this._Assigned_Date = value;
                    this.OnPropertyChanged("Assigned_Date");
                }
            }
        }

        private string _Client_Name = string.Empty;

        public string Client_Name
        {
            get { return this._Client_Name; }

            set
            {
                if (this._Client_Name != value)
                {
                    this._Client_Name = value;
                    this.OnPropertyChanged("Client_Name");
                }
            }
        }

        private string _Notes = string.Empty;

        public string Notes
        {
            get { return this._Notes; }

            set
            {
                if (this._Notes != value)
                {
                    this._Notes = value;
                    this.OnPropertyChanged("Notes");
                }
            }
        }
    }

    public class ItemCollection : System.Collections.ObjectModel.ObservableCollection<Item>
    {
    }
#endif
}